/*
 * Copyright (c) Huawei Device Co., Ltd. 2023. All rights reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef ISECURE_ELEMENT_SERVICE_H
#define ISECURE_ELEMENT_SERVICE_H

#include <string>
#include <vector>
#include "iremote_broker.h"
#include "common_utils.h"

namespace OHOS {
namespace SE {
namespace OMAPI {

class ISecureElementReader;

class ISecureElementService : public OHOS::IRemoteBroker {
public:
    DECLARE_INTERFACE_DESCRIPTOR(u"ohos.se.omapi.ISecureElementService");
    virtual ~ISecureElementService() {}
    /**
     * @brief Get the list of available SE reader names. There must be no duplicated names in the returned list.
     * @param readers The reader names existed.
     * @return The status code for function calling.
     */
    virtual ErrorCode GetReaders(std::vector<std::string> &readers) = 0;
    /**
     * @brief Get the reader instance by the name.
     * @param readerName The reader name
     * @param iface The Reader interface object, used for IPC.
     * @return The status code for function calling.
     */
    virtual ErrorCode GetReaderInterface(const std::string &readerName, sptr<ISecureElementReader> &iface) = 0;
    /**
     * @brief Checks if the application defined by the bundle name is authorized
     * to receive the NFC transaction events for the defined AID.
     * @param readerName The reader name
     * @param aid The SE application ID
     * @param bundleNames The all bundle names to check.
     * @param allowedStatus The checking status for all bundle names, true or false for each one.
     * @return The status code for function calling.
     */
    virtual ErrorCode IsNfcEventAllowed(const std::string &readerName, const std::string &aid,
        std::vector<std::string> bundleNames, std::vector<bool> &allowedStatus) = 0;

    /**
     * @brief RegisterCallerListener se_service process
     * @param obj The remote object of service.
     * @return The status code for function calling.
     */
    virtual ErrorCode RegisterCallerListener(const sptr<IRemoteObject> &obj) = 0;

    /**
     * @brief Shutdown the se_service process if no client bound to service
     * @return The status code for function calling.
     */
    virtual ErrorCode Shutdown() = 0;
};
}  // namespace OMAPI
}  // namespace SE
}  // namespace OHOS
#endif // ISECURE_ELEMENT_SERVICE_H
